package com.ruix.app.ui.app;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.ruix.app.R;
import com.ruix.app.ui.base.BaseActivity;
import com.ruix.app.util.CopyUtil;
import com.ruix.app.util.ToastUtil;


/**
 * Created by hadexs on 2017/5/24.
 */

public class QrcodeTipActivity extends BaseActivity {

    public static Intent getInstance(Context context, String content) {
        Intent intent = new Intent(context, QrcodeTipActivity.class);
        intent.putExtra("qrcode", content);
        return intent;
    }

    TextView textView;
    private String content;


    @Override
    protected int loadViewLayout() {
        return R.layout.activity_qrcode_tip;
    }

    @Override
    protected void initView() {
        Intent intent = getIntent();
        if (intent != null) {
            content = intent.getStringExtra("qrcode");
        }
        textView = (TextView) findViewById(R.id.tv_qrcode_content);
        textView.setText(content);
        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                CopyUtil.clipboardCopy(QrcodeTipActivity.this, content);
                ToastUtil.showNewSuccessMsg("已复制到剪切板");
            }
        });
    }

    @Override
    protected void initLocalData() {

    }

    @Override
    protected void initListener() {

    }
}
